
#ifndef   ___MACROS__H__
#define   ___MACROS__H__

#define   TRUE		1
#define   FALSE	0

#define 	setBit(reg,b)	(reg|=(1UL<<(b)))
#define 	clrBit(reg,b)	(reg&=(~(1UL<<(b))))
#define 	xorBit(reg,b)	(reg^=(1UL<<(b)))
#define 	readBit(reg,b)	(reg&(1UL<<(b)))

#define   SET(BIT)		setBit(BIT)
#define   CLR(BIT)		clrBit(BIT)
#define   XOR(BIT)		xorBit(BIT)
#define   READ(BIT)		readBit(BIT)

#define   set(BIT)		setBit(BIT)
#define   clr(BIT)		clrBit(BIT)
#define   xor(BIT)		xorBit(BIT)
#define   read(BIT)		readBit(BIT)


#define   PIN_OUT(BIT)		setBit(BIT)
#define   PIN_INP(BIT)		clrBit(BIT)

#define   EOF	(-1)

#define  NOP()		asm("nop")


#ifndef NULL
#define NULL	((void*)0)			/**< NULL pointer */
#endif

/* some other useful macros */
#define MIN(x,y)	((x)<(y)?(x):(y))	/**< MIN */
#define MAX(x,y)	((x)>(y)?(x):(y))	/**< MAX */

#define   MSEC		/portTICK_RATE_MS

#endif
